import { createApp } from 'vue'
// import './style.css'

// 引入 element-plus 插件与样式
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
//@ts-ignore忽略当前文件ts类型的检测否则有红色提示(打包会失败)
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'

import 'virtual:svg-icons-register'

import gloablComponent from '@/components/index'

// 引入模板的全局样式
import '@/styles/index.scss'

import router from '@/router'

import pinia from '@/store'

import '@/permisstion'

// 注册指令
import plugins from '@/plugins' 
import SvgIcon from '@/components/SvgIcon/index.vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'


// 分页组件
import Pagination from '@/components/Pagination/index.vue'

import App from './App.vue'

// 获取应用实列对象
const app = createApp(App)

// 全局组件挂载
app.component('Pagination', Pagination)
app.component('svg-icon', SvgIcon)
// 安装element-plus插件
app.use(ElementPlus, {
  locale: zhCn,
})

app.use(gloablComponent)
app.use(router)
app.use(pinia)
app.use(plugins)

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.mount('#app')
